import { _decorator, Component, Node, Vec2, v2 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('TouchPanel')
export default class TouchPanel extends Component {
    public static Instance: TouchPanel;
    @property(Node)
    touchCircle: Node | null = null;
    onLoad() {
        // TouchPanel.Instance = this;
    }
    start() {
        //        // this.node.on(cc.Node.EventType.TOUCH_START, (t) => {
        //        //     const location = t.getLocation();
        //        //     const currentPos = this.node.parent.convertToNodeSpaceAR(location);
        //        //     this.ShowTouchCircle(currentPos);
        //        // }, this, true);

        // this.node.on(cc.Node.EventType.TOUCH_START, (t) => {
        // const location = t.getLocation();
        // const currentPos = this.node.parent.convertToNodeSpaceAR(location);
        // this.ShowTouchCircle(currentPos);
        // }, this, true);

    }
    ShowTouchCircle(_pos: cc.Vec2 = v2(0, 0)) {
        // const node: cc.Node = cc.instantiate(this.touchCircle);
        // node.active = true;
        // node.parent = this.node;

        // node.setPosition(0, 0);
        // node.setPosition(_pos);

        // node.opacity = 255;
        // node.scale = 1;
        // node.width = 10;
        // node.height = 10;
        //        // const duration = 0.5;
        // cc.tween(node)
        // .to(0.4, { width: 100, height: 100 }, { easing: '' })
        // .to(0.4, { opacity: 0 }, { easing: '' })
        // .call(() => {
        // node.destroy();
        // })
        // .start()

        //        // TipPanel.Instance.Show("解锁成功！！！");
    }
}